{extend name="public/base" /} {block name="title"}
<title>关于站点</title>
{__block__}
<link href="//cdn.bootcss.com/limonte-sweetalert2/6.6.8/sweetalert2.min.css" rel="stylesheet">
<style>
    .editor {
        height: 420px;
    }

    .toolbar {
        border-bottom: solid 1px #eee;
    }

    .textcontent {
        height: 400px;
        border: solid 1px #eee;
    }
</style>
<script>
    var uploadUrl = "{:url('admin/config/upload')}";
</script>
{/block} {block name="page-heading"}
<div class="col-sm-4">
    <h2>关于站点</h2>
    <ol class="breadcrumb">
        <li>
            <a href="{:url('admin/index/home')}">主页</a>
        </li>
        <li>
            <strong>关于站点</strong>
        </li>
    </ol>
</div>
{/block} {block name="content"}
<div class="ibox">
    <div class="ibox-content">
        <!-- <h2 class="text-center">关于本站</h2> -->
        <form action="?" method="POST" class="form-horizontal" role="form">
            <div class="form-group">
                <div class="col-sm-12">
                    <div class="title-action">
                        <a href="javasscript:void(0)" class="btn btn-danger" id="clear">清空</a>
                        <button type="submit" class="btn btn-primary">保存</bu>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-12">
                    <div class="editor">
                        <div id="toolbar" class="toolbar">
                        </div>
                        <div id="text" class="textcontent">
                            {$data}
                        </div>
                    </div>
                    <textarea id="content" name="content" style="display:none">{$data}</textarea>
                </div>
            </div>
        </form>
    </div>
    {/block} {block name="script"} {__block__}
    <script src="//cdn.bootcss.com/limonte-sweetalert2/6.6.8/sweetalert2.min.js"></script>
    <script src="//unpkg.com/wangeditor/release/wangEditor.min.js"></script>
    <script src="__CUSTOME__/js/admin.common.js"></script>
    <script>
    var E = window.wangEditor
    var editor = new E('#toolbar', '#text')
    editor.customConfig.uploadImgServer = uploadUrl
    editor.customConfig.uploadImgMaxSize = 3 * 1024 * 1024;
    editor.customConfig.uploadImgMaxLength = 1;
    editor.customConfig.uploadFileName = 'image';
    editor.customConfig.uploadImgHooks = {
        fail: function(xhr, editor, result) {
            swal('自定义提示', result.msg, 'error')
        },
        error: function(xhr, editor) {
        },
        customInsert: function(insertImg, result, editor) {
            var url = result.url
            insertImg(url)
        }
    }
    editor.customConfig.customAlert = function(info) {
        swal('自定义提示', info, 'error')
    }
    editor.customConfig.onchange = function(html) {
        $('#content').val(html);
        // console.log($('#content').val());
    }
    editor.create()
    $('.w-e-toolbar').css('flex-wrap', 'wrap');
    $('#clear').on('click', function() {
        editor.txt.clear()
    });
    </script>
    {/block}